using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class so_vendstatementrepMap : EntityTypeConfiguration<so_vendstatementrep>
    {
        public so_vendstatementrepMap()
        {
            // Primary Key
            this.HasKey(t => new { t.sumfields, t.dimfields });

            // Properties
            this.Property(t => t.Document__)
                .HasMaxLength(7);

            this.Property(t => t.batch)
                .HasMaxLength(10);

            this.Property(t => t.Vendor__)
                .HasMaxLength(10);

            this.Property(t => t.Document_type)
                .HasMaxLength(15);

            this.Property(t => t.Doc_cur)
                .HasMaxLength(5);

            this.Property(t => t.Reference)
                .HasMaxLength(35);

            this.Property(t => t.notes)
                .HasMaxLength(50);

            this.Property(t => t.sumfields)
                .IsRequired()
                .HasMaxLength(39);

            this.Property(t => t.HeaderView)
                .HasMaxLength(50);

            this.Property(t => t.dimfields)
                .IsRequired()
                .HasMaxLength(15);

            // Table & Column Mappings
            this.ToTable("so_vendstatementrep");
            this.Property(t => t.Document__).HasColumnName("Document_#");
            this.Property(t => t.batch).HasColumnName("batch");
            this.Property(t => t.Vendor__).HasColumnName("Vendor_#");
            this.Property(t => t.Document_type).HasColumnName("Document_type");
            this.Property(t => t.Date).HasColumnName("Date");
            this.Property(t => t.Doc_cur).HasColumnName("Doc_cur");
            this.Property(t => t.Amount).HasColumnName("Amount");
            this.Property(t => t.Vendor_Cur_amount).HasColumnName("Vendor_Cur_amount");
            this.Property(t => t.Base_1).HasColumnName("Base_1");
            this.Property(t => t.Base_2).HasColumnName("Base_2");
            this.Property(t => t.Reference).HasColumnName("Reference");
            this.Property(t => t.DocPrimaryKey).HasColumnName("DocPrimaryKey");
            this.Property(t => t.notes).HasColumnName("notes");
            this.Property(t => t.sumfields).HasColumnName("sumfields");
            this.Property(t => t.HeaderView).HasColumnName("HeaderView");
            this.Property(t => t.dimfields).HasColumnName("dimfields");
        }
    }
}
